var WebApp = {};
    	WebApp.Desktop = function(){
    		var thisMainP = this;
    		 var root= new Ext.Panel(
    		 {
    			title: "当前用户："+loginUser.userName,		
    			region : "west",
    			margins: '0 0 0 0',
    			layout:'accordion',
    			layoutConfig: {
					animate: true
				},
				split: true,
				width:'17%',
    			autoScroll : true,
    			collapsible: true,
    			bbar: [{
        			text :'开始',
        			iconCls:'ico-main',
        			menu:new Ext.menu.Menu({
							items: [{
								text:'主题风格',
								menu:{
									items:[{
									text:"默认风格",
									index:0
								},{
									text:"黑色风格",
									index:1
								},{
									text:"绿色风格",
									index:2
								},{
									text:"红褐风格",
									index:3
								},{
									text:"褐色风格",
									index:4
								},{
									text:"灰色风格",
									index:5
								},{
									text:"蓝色风格",
									index:6
								},{
									text:"粉色风格",
									index:7
								},{
									text:"紫色风格",
									index:8
								},{
									text:"红色风格",
									index:9
								}],
								listeners : {
									itemclick:function(item) {
										var t = [
										    ["css/ext-all",'默认风格'],
										    ["thems/css/ext-all-xtheme-black",'黑色风格'],
										    ["thems/css/ext-all-xtheme-green",'绿色风格'],
										    ["thems/css/ext-all-xtheme-brown",'红褐风格'],
										    ["thems/css/ext-all-xtheme-brown02",'褐色风格'],
										    ["thems/css/ext-all-xtheme-gray",'灰色风格'],
										    ["thems/css/ext-all-xtheme-blue03",'蓝色风格'],
										    ["thems/css/ext-all-xtheme-pink",'粉色风格'],
										    ["thems/css/ext-all-xtheme-purple",'紫色风格'],
										    ["thems/css/ext-all-xtheme-red03",'红色风格']
										];
										Ext.util.Cookies.set('styleNumber',item.index);
										var style = t[item.index][0];
										Ext.util.CSS.swapStyleSheet('window', 'ext-3.4.0/resources/'+style+'.css');
									}
								}
								}
							},{
									text:'关于系统',
									iconCls:'ico-info',
									handler: function(){
										new Ext.Window({
												closeAction: 'close',
												resizable:false,
												modal:true,
												title:'关于本系统',
												html:'BSS扩展系统',
												width:300,
												height:200
											}).show();
								}},
								{
									text:'退出系统',
									iconCls:'ico-delete',
									handler: function(){
											Ext.Msg.confirm('操作提示','您确定要退出本系统吗'	,function(btn){
													if('yes'==btn) {
															window.location.href="user_userLogOut.action";
														}
											});
										}
								}]
            			})
    			}],
    			items:[new MenuTreePanel({
    				url:'menu.php',
    				rootId:'0'
    			})]
    		});
    		this.Banner = new Ext.Panel({
    			region : "north",
    			margins: '0 0 0 0',
    			border:false ,
    			width :"100%",
    			renderTo : "header",			
    			tbar : this.createTopMenu()
    		});
    		this.WestMenu=root;
    		this.MainPanel = new Ext.TabPanel({
    			id : "main-panel",
    			region : "center",
    			split: true,
    			title:'sss',
    			border:false ,
    			enableTabScroll:true,
    			defaults: {autoScroll:true},
			    activeTab: 0,
			    height:"100%",
			    items: [new Welcome.Main()]
			});			

			WebApp.Desktop.superclass.constructor.call(this, {
				layout : "border",
				renderTo : "mainpanel",
				items : [this.Banner, this.WestMenu, this.MainPanel]
			});    		
    	}
    	Ext.extend(WebApp.Desktop, Ext.Viewport, {
    		createTopMenu : function(){
    			return ['->',{xtype:'label',text:'注销'}]
    		}
    	});
		Ext.onReady(function(){
			styleNum = Ext.util.Cookies.get('styleNumber')||styleNum;
			var t = [
					    ["css/ext-all",'默认风格'],
					    ["thems/css/ext-all-xtheme-black",'黑色风格'],
					    ["thems/css/ext-all-xtheme-green",'绿色风格'],
					    ["thems/css/ext-all-xtheme-brown",'红褐风格'],
					    ["thems/css/ext-all-xtheme-brown02",'褐色风格'],
					    ["thems/css/ext-all-xtheme-gray",'灰色风格'],
					    ["thems/css/ext-all-xtheme-blue03",'蓝色风格'],
					    ["thems/css/ext-all-xtheme-pink",'粉色风格'],
					    ["thems/css/ext-all-xtheme-purple",'紫色风格'],
					    ["thems/css/ext-all-xtheme-red03",'红色风格']
					];
			var style = t[styleNum][0];
			Ext.util.CSS.swapStyleSheet('window', 'ext-3.4.0/resources/'+style+'.css');
									
			var MainAPP = new WebApp.Desktop();
			
		});
Ext.QuickTips.init();
		